package app.view.mediator
{	
    import app.facade.App; 
	import app.facade.EApp;
	import app.view.component.Background;
	import app.view.component.moment.Module;
	import app.view.component.tooltips.ToolTip;
	import flash.events.Event;
	import org.puremvc.as3.interfaces.*;
    import org.puremvc.as3.patterns.mediator.Mediator;
	import org.osflash.thunderbolt.Logger;
    
    /**
     * @author hungconcon
     */
    public class ToolTipMediator extends Mediator implements IMediator
    {
        public static const NAME:String = "ToolTipMediator";	
		
        public function ToolTipMediator( viewComponent:Object ){
            super( NAME, viewComponent );						
        }	 
		override public function listNotificationInterests():Array {
            return [
						App.PUBLIC_STATIC_HERE
                   ];
        }
        override public function handleNotification( note:INotification ):void {
			var name:String  = note.getName();
			var value:Object = note.getBody();
			switch (name){
				case App.PUBLIC_STATIC_HERE: break;
				default: break;
            }
        }   
		override public function onRegister():void {
			super.onRegister();		
			ui.addEventHandler(App.RIGISTER_TOOLTIP,  		eventHandlers);
		}            		
		private function eventHandlers( event:Event ):void {
			switch( event.type ) {
				case App.RIGISTER_TOOLTIP: 
					ui.register(event.currentTarget.movie, event.currentTarget.text);
				break;
				default: break;
			}
		}
        protected function get ui():ToolTip{
            return viewComponent as ToolTip;
        }
    }
}